/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.hagopa.games.moneypool.msgs.ContentTypes.game;

import java.nio.ByteBuffer;
import org.hagopa.games.moneypool.msgs.IMsgContent;

/**
 *
 * @author Igor
 */
public class UpgradePropCT implements IMsgContent{
    private int marshalledSize = 0;
    private int upgradeLvl = 0;
    private int fieldId = 0;

    public byte[] marshallToByte() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public boolean unmarshallFromByte(byte[] content) {
        ByteBuffer dataArray = ByteBuffer.wrap(content);
        if(null == dataArray)
        {
                return false;
        }
        dataArray.clear();

        this.fieldId = dataArray.getInt();
        System.out.println("[PropertyActionCT](unmarshallFromByte) - Field Id:" + this.fieldId);
        this.upgradeLvl = dataArray.getInt();
        System.out.println("[PropertyActionCT](unmarshallFromByte) - upgradeLvl:" + this.upgradeLvl);

        return true;
    }

    public int getSize() {
        return this.marshalledSize;
    }
    public int getFieldId()
    {
        return this.fieldId;
    }
    public int getUpgradeLvl()
    {
        return this.upgradeLvl;
    }

    public String getConcatContent() {
        String outstr = null;
        outstr = String.valueOf(this.fieldId) + String.valueOf(this.upgradeLvl);
        return outstr;
    }

}
